#ifndef _STATIC_ARRAY_H_
#define _STATIC_ARRAY_H_

#include "Array.h"

namespace MySTL
{

template < typename T, int N >
class StaticArray : public Array<T>
{
public:
	StaticArray();
	StaticArray(const StaticArray& obj);
	StaticArray<T, N>& operator =(const StaticArray<T, N>& obj);

	int length() const;

protected:
	virtual void copy(const StaticArray& obj);

protected:
	T m_space[N];
};

template < typename T, int N >
StaticArray<T, N>::StaticArray()
{
	this->m_array = m_space;
}

template < typename T, int N >
void StaticArray<T, N>::copy(const StaticArray<T, N>& obj)
{
	for (int i = 0; i < N; ++i)
	{
		this->m_array[i] = obj.m_array[i];
	}
}

template < typename T, int N >
StaticArray<T, N>::StaticArray(const StaticArray<T, N>& obj)
{
	copy(obj);
}

template < typename T, int N >
StaticArray<T, N>& StaticArray<T, N>::operator =(const StaticArray<T, N>& obj)
{
	if (this != &obj)
	{
		copy(obj);
	}

	return *this;
}

template < typename T, int N >
int StaticArray<T, N>::length() const
{
	return N;
}

}

#endif